package config

import (
	"io"
	"log"
	"os"
)

func LogInit() {
	file, err := os.OpenFile("log/test.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, os.ModePerm)
	if err != nil {
		file, err = os.Create("log/test.log")
		if err != nil {
			log.Fatal("create file log/test.log failed")
		}
	}
	writer := io.MultiWriter(file, os.Stdout)
	log.SetOutput(writer)
}
